/**
 * @file 数据仓库配置
 * @module store/index
 * @author 月落 <yueluo.yang@qq.com>
 */

/**
 * @requires libs/store - 数据仓库工具
 * @requires config/topic - 主题配置
 * @requires config/version - 版本号
 */
import Store from '../libs/store';
import { TOPIC } from '../config/topic';
import { VERSION } from '../config/version';

// 导出数据仓库
export default new Store({
  state: {
    version: VERSION,
    topic: TOPIC.STORY,
    type: '',
    playParams: {}
  },
  mutations: {
    changeState: (state, data) => {
      Object.keys(data).forEach(key => (state[key] = data[key]));
    }
  }
});